package stark.app.uibase;

import android.view.View;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.listener.OnItemClickListener;

import stark.app.R;
import stark.app.databinding.ActivityBaseListBinding;
import stark.app.frame.TextItemAdapter;
import stark.common.basic.base.BaseNoModelActivity;

public class BaseListActivity extends BaseNoModelActivity<ActivityBaseListBinding> implements OnItemClickListener {

    protected TextItemAdapter mAdapter;

    @Override
    protected int onCreate() {
        return R.layout.activity_base_list;
    }

    @Override
    protected void initView() {
        mAdapter = new TextItemAdapter();
        RecyclerView rv = mDataBinding.rvText;
        rv.setLayoutManager(new LinearLayoutManager(mContext));
        rv.setAdapter(mAdapter);
        mAdapter.setOnItemClickListener(this);
    }

    @Override
    protected void initData() {
        mDataBinding.setLifecycleOwner(this);
    }

    @Override
    public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {

    }
}